package siruna.WE.core.model;

import java.util.HashMap;
import java.util.List;

import org.apache.http.MethodNotSupportedException;

import siruna.WE.core.events.EventListener;

public abstract class Block {
	String id;
	String widgetName;
	public String getWidgetName() {
		return widgetName;
	}

	public void setWidgetName(String widgetName) {
		this.widgetName = widgetName;
	}

	EventListener eventHandler;
	public EventListener getEventHandler() {
		return eventHandler;
	}

	public void setEventHandler(EventListener eventHandler) {
		this.eventHandler = eventHandler;
	}

	HashMap<String, String> attributes;

	public Block() {
		super();
		attributes = new HashMap<String, String>();
	}

	public void setAttribute(String att, String val) {
		attributes.put(att, val);
	}

	public HashMap<String, String> getAttributes() {
		return attributes;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public abstract byte[] toByteArray() throws MethodNotSupportedException;

	public abstract List toList() throws MethodNotSupportedException;


	
}
